<?php

App::uses('AuthComponent', 'Controller/Component');

class User extends AppModel {
    
    public $name = 'User';
    
    public function beforeSave($options = array()) {
             
        if (!empty($this->data['User']['password'])) {
            $this->data['User']['password'] = AuthComponent::password($this->data['User']['password']);
        }  else {
          
    
        }
        return true;
    }
    
      
    
     public $validate = array(
            'email' => array(
            'rule' => 'notEmpty'
        ),
        'data' => array(
            'rule' => 'notEmpty'
        ),
        'telefone' => array(
            'rule' => 'notEmpty'
        ),
        'username' => array(
            'rule' => 'notEmpty'
        ),
        'password' => array(
            'rule' => 'notEmpty'   
           
        )
    );
      
}
?>